package com.java01.apache.commons.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.commons.io.IOUtils;

public class CopyLargeFile {

	public static void main(String[] args) {
		File src = new File("D:/srcLargeFile");
		File dest = new File("D:/destFile");
		
		try {
			long copiedSize=IOUtils.copyLarge(new FileInputStream(src), new FileOutputStream(dest));
			System.out.println(copiedSize+" bytes copied");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
